﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace ABLocal
{
    public enum UILayer
    {
        UI,
        TOP,
        ALBERT,
    }

    public class UIMgr : MonoBehaviour
    {
        public List<GameObject> uiRoots;

        public GameObject GetLayerRoot(UILayer layer)
        {
            foreach (var item in uiRoots)
            {
                if (item.name.Equals(layer.ToString()))
                {
                    return item;
                }
            }
            return null;
        }
        public Dictionary<UILayer, LayerStack> layerDic = new Dictionary<UILayer, LayerStack>();
        

        public void PushPanel(UILayer layer,string path,object data)
        {
            if (!layerDic.ContainsKey(layer))
            {
                layerDic.Add(layer, new LayerStack());
            }
            ///todo...
        }

    }

    public class LayerStack
    {
        Stack<LayerArg> layerStack = new Stack<LayerArg>();
    }

    public class LayerArg
    {
        GameObject root;
        object invalue;

        public LayerArg(GameObject root, object data)
        {
            this.root = root;
            this.invalue = data;
        }
    }
}